package com.itcast.n1_内存调优;

import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: jvm
 * @description: -Xms256m -Xmx256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\jvm\dump\test1.hprof
 * @author: flyduck
 * @create: 2024-10-16 17:44
 **/
@RestController
@RequestMapping("/leak3")
public class Test18_内存诊断_利用参数出现内存溢出自动生成内存快照 {

    @GetMapping("/test1")
    public void test1() throws InterruptedException {
        byte[] bytes = new byte[1024 * 1024 * 100];//100m
        Thread.sleep(10 * 1000L);
    }
}

